<template>
  <div>
    <!-- 底部选项卡 -->

    <router-view />

    <van-tabbar active-color="#7bb1b1" route>
      <van-tabbar-item icon="home-o" replace to="/home/index"
        >首页</van-tabbar-item
      >
      <van-tabbar-item icon="bullhorn-o" replace to="/home/knowledge"
        >宠物</van-tabbar-item
      >
      <van-tabbar-item
        ><van-icon name="add-square" size="40"
      /></van-tabbar-item>
      <van-tabbar-item icon="chat-o" badge="9">消息</van-tabbar-item>
      <van-tabbar-item icon="user-o" replace to="/me">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  watch: {
    $route(to, from) {
      // 监听底部导航的变化
      //console.log(to.path, from.path);
      window.scrollTo(0, 0);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>